import axios from '@/libs/api.request'
let rol = '/oms/merchant/'
// 员工管理
export const getEmployeeList = (data) => { // 这个接口目前不知道有什么用 不含分页
  return axios.request({
    url: rol + 'user/list',
    method: 'post',
    data: data
  })
}
export const getEmployeeQuery = (data) => { // 这个查询接口 包含分页
  return axios.request({
    url: rol + 'user/query',
    method: 'post',
    data: data
  })
}
export const setEmployeeCreate = (data) => {
  return axios.request({
    url: rol + 'user/create',
    method: 'post',
    data: data
  })
}
export const setEmployeeUpdate = (data) => {
  return axios.request({
    url: rol + 'user/update',
    method: 'post',
    data: data
  })
}
export const getRoleList = (data) => {
  return axios.request({
    url: rol + 'role/list',
    method: 'post',
    data: data
  })
}
export const getEmployeeTree = (data) => {
  return axios.request({
    url: rol + 'org/tree/all',
    method: 'post',
    data: data
  })
}
export const setSwitchDisable = (data) => {
  return axios.request({
    url: rol + 'user/status/disable',
    method: 'post',
    data: data
  })
}
export const setSwitchEnable = (data) => {
  return axios.request({
    url: rol + 'user/status/enable',
    method: 'post',
    data: data
  })
}
export const setUserDelete = (data) => {
  return axios.request({
    url: rol + 'user/delete',
    method: 'post',
    data: data
  })
}
export const getUserInfos = (data) => {
  return axios.request({
    url: rol + 'user/info',
    method: 'post',
    data: data
  })
}
export const setPasswordUpdate = (data) => { // 修改密码
  return axios.request({
    url: rol + 'user/password/update',
    method: 'post',
    data: data
  })
}
export const getUserFunc = (data) => { // 获取用户功能权限
  return axios.request({
    url: '/oms/merchant/user/permissions/functions',
    method: 'post',
    data: data
  })
}
export const getUserData = (data) => { // 获取用户数据权限
  return axios.request({
    url: '/oms/merchant/user/permissions',
    method: 'post',
    data: data
  })
}
export const getResourceList = (data) => { // 获取操作系统
  return axios.request({
    url: '/oms/platform/resource/list',
    method: 'post',
    data: data
  })
}
export const setDataGrant = (data) => { // 设置数据权限
  return axios.request({
    url: '/oms/merchant/user/permission/data/grant',
    method: 'post',
    data: data
  })
}
// 导出员工列表
export const exportEmployee = (data) => { // 设置数据权限
  return axios.request({
    url: '/oms/merchant/user/export',
    method: 'post',
    data: data,
    responseType: 'blob'
  })
}

// 验证xls数据
export const veriEmployeeXls = data => axios.request({
  url: rol + 'user/verify/file',
  method: 'post',
  data,
  headers: {
    'Content-Type': 'multipart/form-data'
  }
})

// 导入xls数据
export const employeeXlsImport = data => axios.request({
  url: rol + 'user/import',
  method: 'post',
  data
})

// 初始化密码
export const resetPassword = data => axios.request({
  url: '/oms/merchant/user/initialize/password',
  method: 'post',
  data
})
